package com.service.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.service.consumer.service.FeignService;
import com.service.consumer.service.IndexService;

@RequestMapping("/")
@Controller
public class IndexController {

	@Autowired
	IndexService indexService;
	@Autowired
	FeignService feignService;
	
	
	@RequestMapping("index")
	public @ResponseBody String index(@RequestParam(value="name",defaultValue="消费者巫巫",required=false) String name){
		System.out.println("允许访问！");
		return indexService.index(name);
	}
	
	@ResponseBody
	@RequestMapping("feign")
	public String  Feign(@RequestParam(value="name",defaultValue="消费者巫巫",required=false) String name){
		return feignService.Feign(name);
	}
}
